package com.example.config;

import com.example.interceptors.JWTInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.ArrayList;
import java.util.Arrays;

@Configuration
public class InterceptorConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {

        registry.addInterceptor(new JWTInterceptor())
                .addPathPatterns("/**")      //所有用户进行token验证
                .excludePathPatterns("/login", "/ClassroomList","/courseList","/queryHonor","queryInformation","/notification","/primaryList","/student","/teacher","/teachingList","/PlaceList"); //放行
    }

}
